from django.conf.urls import url

from web.views import index,cart,orders

urlpatterns = [
   url(r'^$', index.index, name="web_index"),

   #前台登录路由
   url(r'^login$', index.login, name="web_login"),
   url(r'^dologin$', index.dologin, name="web_dologin"),
   url(r'^logout$', index.logout, name="web_logout"),
   url(r'^verify$', index.verify, name="web_verify"),

   #购物车路由
   #url(r'^cart$',cart.index,name='cart_index'), #浏览购物车
   url(r'^cart/add/(?P<pid>[0-9]+)$', cart.add,name='cart_add'), #添加购物车
   url(r'^cart/del/(?P<pid>[0-9]+)$', cart.delete,name='cart_del'), #从购物车中删除一个商品
   url(r'^cart/clear$', cart.clear,name='cart_clear'), #清空购物车
   url(r'^cart/change$', cart.change,name='cart_change'), #更改购物车中商品数量

   #订单结算路由
   url(r'^orders/insert$', orders.insert,name='orders_insert'), #执行订单添加操作

   #查看订单路由
   url(r'^orders/(?P<pIndex>[0-9]+)$', orders.odindex,name='orders'), #查看订单
   url(r'^orders/detail$', orders.oddetail,name='orders_detail'), #查看订单详情
   url(r'^orders/status$', orders.odstatus,name='orders_status'), #修改订单状态


]